#!/bin/sh

set -e

rm -rf unittest-data
mkdir unittest-data
cd unittest-data
ln -s ../../data/main.ascdat .
ln -s ../../data/dialog/asc2_dlg.zip .
if [ -e ../../extra-data/pbp.ascdat ] ; then
   echo "Testing PBP data as well"
   ln -s ../../extra-data/pbp.ascdat .
fi
cd ..
if [ "$1" = "--valgrind" ] 
then
   prefix="valgrind --tool=memcheck --num-callers=30 --leak-resolution=med --freelist-vol=100000000 --error-limit=no"
else
   prefix="" 
fi
$prefix ../source/unix/asc/unittester -c asc2rc
